package com.bw.unit6.arouter

import android.content.Context
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.service.DegradeService
import com.alibaba.android.arouter.launcher.ARouter

/**
 *
 * @ClassName: JiangjiService
 * @Description: 全局降级页面处理
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/24 12:17 PM
 * @Version: 1.0
 */
@Route(path = "/test/error")
class JiangjiService :DegradeService {
    override fun init(context: Context?) {

    }

    override fun onLost(context: Context?, postcard: Postcard?) {
        //当路由路径找不到时，页面跳转错误时，会执行该方法
        //greenChannel() 不走登录拦截器
        ARouter.getInstance().build("/test/ErrorActivity").greenChannel().navigation()
    }
}